<?php 
$cs=Yii::app()->clientScript;
$cs->registerScript('path_schedule_dialog_view',<<<END
$(document).bind('keydown',function(e){if(e.keyCode==27){parent.$.modal.close();}});
$("table.dataGrid tr:gt(0)").click(function(){
	\$parent=$(window.parent.document);
	\$parent.find("#Schedule_list_fk_path_id").val($(this).find("a:eq(0)").attr('class'));
	\$parent.find("#Schedule_list_deliver_place").val($(this).find("a:eq(0)").text()).removeClass('error').next('span').remove();
	\$parent.find("#Schedule_list_arrival_place").val($(this).find("a:eq(1)").text()).removeClass('error').next('span').remove();
	\$parent.find("#Schedule_list_mileage").val($(this).find("a:eq(2)").text()).removeClass('error').next('span').remove();
	parent.$.modal.close();
	return false;
});
END
)
?>
<?php echo CHtml::beginForm(array($this->action->id));?>
<div style="padding-bottom:10px">
	起运地：<input type="text" name="keys[loading_place]" size="7" value="<?php echo isset($_GET['keys']['loading_place'])?$_GET['keys']['loading_place']:'';?>"/>&nbsp;&nbsp;
	到达地：<input type="text" name="keys[pod_place]" size="7" value="<?php echo isset($_GET['keys']['pod_place'])?$_GET['keys']['pod_place']:'';?>"/>&nbsp;&nbsp;
	模糊查询：<input type="radio" name="keys[blur]" value="1" checked/>是  
	<input type="radio" name="keys[blur]" value="0" <?php echo isset($_GET['keys']['blur'])&&$_GET['keys']['blur']==0?'checked':'';?>/>否&nbsp;&nbsp;
	<input type="submit" value="搜索"/>
</div>
<?php echo CHtml::endForm();?>
<table class="dataGrid" width=90%>
  <tbody>
  	<tr><td align="center">起运地</td><td align="center">到达地</td><td align="center">运输里程</td></tr>
<?php foreach($models as $n=>$model): ?>
	<tr>
	<td width="100px" align="center"><a href="#" class="<?php echo $model->id;?>"><?php echo $model->loading_place;?></a></td>
	<td align="center"><a href="#"><?php echo $model->pod_place;?></a></td>
	<td width="200px" align="center"><a href="#"><?php echo $model->mileage;?></a></td>
	</tr>
<?php endforeach; ?>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages,'maxButtonCount'=>Yii::app()->params['dialog'][$this->action->id]['maxButtonCount'])); ?>